ARD2  1.00 for Rev B. Hardware
Airbag Reference Demonstrator using MPC5604P
CG147_Diag.c File Reference
#include "derivative.h"
#include "Compile_Options.h"
#include "CG147.h"
#include "CG147_Diag.h"
#include "HAL.h"
#include "MailScheduler.h"
#include "DSPI.h"
#include "SIU.h"
#include "Utils.h"

Functions

uint32_t u32fnSBCPerformInitialTestsPOM (const uint8_t u8ERx, const uint8_t u8TestIndex)
 This routine performs initial tests on the SBC regarding POM at startup to guarantee operation.
uint32_t u32fnSBCPerformInitialTestsFLM (const uint16_t cu16SquibMask)
 Automatizes the request of all FLM tests, namely u32fnSBCFLMLeakageMeasP1, u32fnSBCFLMLeakageMeasP2, and u32fnSBCFLMResistanceMeasurement.
uint32_t u32fnSBCFLMLeakageMeasP1 (uint8_t u8IgnitionPin, uint8_t u8LowLeakage)
 This routine performs the Firing Loop Module leakage measurement on ignition pins but doesn't wait for the response, which is calculated within u32fnSBCFLMLeakageMeasP2.
uint32_t u32fnSBCFLMLeakageMeasP2 (uint8_t u8LowLeakage, uint8_t u8Counter, uint16_t *pu16Aout)
 This routine gathers the result of the configuration performed by u32fnSBCFLMLeakageMeasP1, and formats it accordingly.
uint32_t u32fnSBCFLMResistanceMeasurement (const uint8_t u8IgnitionPinHigh, const uint8_t u8IgnitionPinLow, const uint8_t u8Counter)
 This routine performs the Firing Loop Module resistance measurement of squibs.
uint32_t u32fnSBCTestMuxAndADC (uint8_t u8TestIndex)
 Performs one of the tests defined in cau8SBCInitialTestAnaHeadSettings and cau8SBCInitialTestAnaMUXChannel as defined by the passed argument. These tests are meant to verify the integrity of the ADC and Mux within the SBC, and are required to guarantee optimum behavior of the part.
uint8_t u8fnCG147ReadAIn (const uint8_t cu8DSPIInstance1, const uint8_t cu8DSPIInstance2, const uint8_t cu8ChipSelect, const uint8_t cu8Step, const uint8_t cu8CG147Ch, uint16_t *pu16ADCResult, uint32_t *pu32Time)

Variables

const uint8_t cu8SizeOfSBCTests = N_ELEMENTS(cau8SBCTests)
const uint8_t cau8SBCInitialTestAoutRoutesIGH []
const uint8_t cau8SBCInitialTestAoutRoutesIGL []
const uint8_t cu8SizeOfTestAnaHeadSettings = N_ELEMENTS(cau8SBCInitialTestAnaHeadSettings)

Detailed Description

Copyright (c) 2011 Freescale Semiconductor Freescale Confidential Proprietary

Author:
Freescale Semiconductor
SASD Automotive
r11515
Version:
Date:
Dec 9, 2011
Warning:
(If needed)

History:


Function Documentation

uint32_t u32fnSBCFLMLeakageMeasP1 ( uint8_t  u8IgnitionPin,
uint8_t  u8LowLeakage 
)

This routine performs the Firing Loop Module leakage measurement on ignition pins but doesn't wait for the response, which is calculated within u32fnSBCFLMLeakageMeasP2.

Parameters:
u8IgnitionPin,:Squib on which the test is to be performed, as specified in cau8SBCInitialTestAoutRoutesIGH and cau8SBCInitialTestAoutRoutesIGL
u8LowLeakage,:High (CLEAR) leakage or Low (TRUE) leakage detection
Returns:
Zero if no problems, otherwise MAILBOX_IS_BEING_WRITTEN, or MAILBOX_CAPACITY_HAS_BEEN_REACHED;
uint32_t u32fnSBCFLMLeakageMeasP2 ( uint8_t  u8LowLeakage,
uint8_t  u8Counter,
uint16_t *  pu16Aout 
)

This routine gathers the result of the configuration performed by u32fnSBCFLMLeakageMeasP1, and formats it accordingly.

Parameters:
u8LowLeakage,:High (CLEAR) leakage or Low (TRUE) leakage detection
u8Counter,:0 - 11, index for the squib to be tested.
pu16Aout,:Pointer to 16-bit value to hold the test result (for further reference).
Returns:
u32Status: Clear if all ok; SBC_TEST_SCHEDULER_FAILED if there was a problem reading back from the scheduler; SBC_TEST_SBC_ADC_FAILED if the given test instance has failed; SBC_TEST_FLM_LEAK_FAILED if the selected test was high-leakage related and it was failed; SBC_TEST_FLM_LOWLEAK_FAILED if the selected test was low-leakage related and it was failed; All failed status words will contain a flag corresponding to the u8Counter variable passed.
uint32_t u32fnSBCFLMResistanceMeasurement ( const uint8_t  u8IgnitionPinHigh,
const uint8_t  u8IgnitionPinLow,
const uint8_t  u8Counter 
)

This routine performs the Firing Loop Module resistance measurement of squibs.

Parameters:
u8IgnitionPinHigh,:Command for the ignition pin high. Contained within cau8SBCInitialTestAoutRoutesIGH.
u8IgnitionPinLow,:Command for the ignition pin low. Contained within cau8SBCInitialTestAoutRoutesIGL
u8Counter,:0 - 11, index for the squib to be tested.
Returns:
u32Status: Clear if all ok; SBC_TEST_DIS_ALP_FAILED if the ALP pin is high (indicating a faulty watchdog interaction); SBC_TEST_SCHEDULER_FAILED if there was a problem either writing to the scheduler or reading back from it; SBC_TEST_FLM_RESISTANCE_FAILED if the result was outside the pre-established limits. The last two error flags will be accompanied by a u8Counter-relative flag.
uint32_t u32fnSBCPerformInitialTestsFLM ( const uint16_t  cu16SquibMask)

Automatizes the request of all FLM tests, namely u32fnSBCFLMLeakageMeasP1, u32fnSBCFLMLeakageMeasP2, and u32fnSBCFLMResistanceMeasurement.

Parameters:
cu16SquibMask,:Mask list with the squibs to be tested (BIT0 = 1 means squib 0 will be tested, and so on).
Returns:
Zero if no problems; otherwise MAILBOX_IS_BEING_WRITTEN, or MAILBOX_CAPACITY_HAS_BEEN_REACHED; SBC_TEST_SCHEDULER_FAILED if there was a problem reading back from the scheduler; SBC_TEST_SBC_ADC_FAILED if the given test instance has failed; SBC_TEST_FLM_LEAK_FAILED if the selected test was high-leakage related and it was failed; SBC_TEST_FLM_LOWLEAK_FAILED if the selected test was low-leakage related and it was failed; SBC_TEST_FLM_RESISTANCE_FAILED if the resistance was outside the pre-established limits. All failed status words will contain a flag corresponding to the failed squibs.
uint32_t u32fnSBCPerformInitialTestsPOM ( const uint8_t  u8ERx,
const uint8_t  u8TestIndex 
)

This routine performs initial tests on the SBC regarding POM at startup to guarantee operation.

Parameters:
u8ERx,:ERx line to be tested.
u8TestIndex,:Index of the test to be performed, as defined in cau8SBCTests.
Returns:
u32Status: Clear if all ok; SBC_TEST_SCHEDULER_FAILED if there's a problem reading back from SBC; SBC_TEST_UNEXPECTED_SPI_RESULT if the SBC response is not as expected; SBC_TEST_HI_LIMIT_FAILED or SBC_TEST_LO_LIMIT_FAILED (self-explanatory). A flag for each failed ER channel is also added, from BIT0 to BIT5, corresponding to each of the ER channels that were failed somewhere.
uint32_t u32fnSBCTestMuxAndADC ( uint8_t  u8TestIndex)

Performs one of the tests defined in cau8SBCInitialTestAnaHeadSettings and cau8SBCInitialTestAnaMUXChannel as defined by the passed argument. These tests are meant to verify the integrity of the ADC and Mux within the SBC, and are required to guarantee optimum behavior of the part.

Parameters:
u8TestIndex,:Index of test to perform, referring to elements in cau8SBCInitialTestAINADCVoltages
Returns:
u32Status: Clear if all ok; SBC_TEST_SCHEDULER_FAILED if there was a problem either writing to the scheduler or reading back from it; SBC_TEST_SBC_ADC_FAILED if the given test instance has failed.

Variable Documentation

const uint8_t cau8SBCInitialTestAoutRoutesIGH[]
Initial value:
{
  SBC_AOUT_IGH1, SBC_AOUT_IGH2, SBC_AOUT_IGH3, SBC_AOUT_IGH4, SBC_AOUT_IGH5,
  SBC_AOUT_IGH6, SBC_AOUT_IGH7, SBC_AOUT_IGH8, SBC_AOUT_IGH9, SBC_AOUT_IGH10,
  SBC_AOUT_IGH11, SBC_AOUT_IGH12 }
const uint8_t cau8SBCInitialTestAoutRoutesIGL[]
Initial value:
{
  SBC_AOUT_IGL1, SBC_AOUT_IGL2, SBC_AOUT_IGL3, SBC_AOUT_IGL4, SBC_AOUT_IGL5,
  SBC_AOUT_IGL6, SBC_AOUT_IGL7, SBC_AOUT_IGL8, SBC_AOUT_IGL9, SBC_AOUT_IGL10,
  SBC_AOUT_IGL11, SBC_AOUT_IGL12 }
const uint8_t cu8SizeOfSBCTests = N_ELEMENTS(cau8SBCTests)

As its name states